<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function getRandomIntInclusive(min, max) {
            min = Math.ceil(min);
            max = Math.floor(max);
            return Math.floor(Math.random() * (max - min + 1)) + min; 
        }
        function findin(arr,x)
        {
            for(var i=0;i<arr.length;i++){
                if(x==arr[i])return 1;
            }
            return 0;
        }

        var arr = ['鹿晗','王俊凯','蔡徐坤','彭于晏','周杰伦','刘德华','赵本山'];
        var num;
        var arr2 = [];
        for(var i=0;i<4;i++){
            num = getRandomIntInclusive(0,6);
            if(findin(arr2,num)==1){
                i--;
                continue;
            }
            arr2[arr2.length] = num;
            console.log(arr[num]);
        }
    </script>
</head>
<body>
    
</body>
</html>